package com.gec.zhs.entity.po;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;

/**
 * 定时任务
 * @TableName openjob
 */
@TableName(value ="openjob")
@Data
public class Openjob implements Serializable {
    /**
     * Id
     */
    @TableId
    private String id;

    /**
     * 任务名称
     */
    private String jobname;

    /**
     * 任务执行次数
     */
    private Integer runcount;

    /**
     * 异常次数
     */
    private Integer errorcount;

    /**
     * 下次执行时间
     */
    private Date nextruntime;

    /**
     * 最后一次执行时间
     */
    private Date lastruntime;

    /**
     * 最后一次失败时间
     */
    private Date lasterrortime;

    /**
     * 任务执行方式0：本地任务；1：外部接口任务
     */
    private Integer jobtype;

    /**
     * 任务地址
     */
    private String jobcall;

    /**
     * 任务参数，JSON格式
     */
    private String jobcallparams;

    /**
     * CRON表达式
     */
    private String cron;

    /**
     * 任务运行状态（0：停止，1：正在运行，2：暂停）
     */
    private Integer status;

    /**
     * 备注
     */
    private String remark;

    /**
     * 创建时间
     */
    private Date createtime;

    /**
     * 创建人ID
     */
    private String createuserid;

    /**
     * 创建人
     */
    private String createusername;

    /**
     * 最后更新时间
     */
    private Date updatetime;

    /**
     * 最后更新人ID
     */
    private String updateuserid;

    /**
     * 最后更新人
     */
    private String updateusername;

    /**
     * 所属部门
     */
    private String orgid;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        Openjob other = (Openjob) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getJobname() == null ? other.getJobname() == null : this.getJobname().equals(other.getJobname()))
            && (this.getRuncount() == null ? other.getRuncount() == null : this.getRuncount().equals(other.getRuncount()))
            && (this.getErrorcount() == null ? other.getErrorcount() == null : this.getErrorcount().equals(other.getErrorcount()))
            && (this.getNextruntime() == null ? other.getNextruntime() == null : this.getNextruntime().equals(other.getNextruntime()))
            && (this.getLastruntime() == null ? other.getLastruntime() == null : this.getLastruntime().equals(other.getLastruntime()))
            && (this.getLasterrortime() == null ? other.getLasterrortime() == null : this.getLasterrortime().equals(other.getLasterrortime()))
            && (this.getJobtype() == null ? other.getJobtype() == null : this.getJobtype().equals(other.getJobtype()))
            && (this.getJobcall() == null ? other.getJobcall() == null : this.getJobcall().equals(other.getJobcall()))
            && (this.getJobcallparams() == null ? other.getJobcallparams() == null : this.getJobcallparams().equals(other.getJobcallparams()))
            && (this.getCron() == null ? other.getCron() == null : this.getCron().equals(other.getCron()))
            && (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus()))
            && (this.getRemark() == null ? other.getRemark() == null : this.getRemark().equals(other.getRemark()))
            && (this.getCreatetime() == null ? other.getCreatetime() == null : this.getCreatetime().equals(other.getCreatetime()))
            && (this.getCreateuserid() == null ? other.getCreateuserid() == null : this.getCreateuserid().equals(other.getCreateuserid()))
            && (this.getCreateusername() == null ? other.getCreateusername() == null : this.getCreateusername().equals(other.getCreateusername()))
            && (this.getUpdatetime() == null ? other.getUpdatetime() == null : this.getUpdatetime().equals(other.getUpdatetime()))
            && (this.getUpdateuserid() == null ? other.getUpdateuserid() == null : this.getUpdateuserid().equals(other.getUpdateuserid()))
            && (this.getUpdateusername() == null ? other.getUpdateusername() == null : this.getUpdateusername().equals(other.getUpdateusername()))
            && (this.getOrgid() == null ? other.getOrgid() == null : this.getOrgid().equals(other.getOrgid()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getJobname() == null) ? 0 : getJobname().hashCode());
        result = prime * result + ((getRuncount() == null) ? 0 : getRuncount().hashCode());
        result = prime * result + ((getErrorcount() == null) ? 0 : getErrorcount().hashCode());
        result = prime * result + ((getNextruntime() == null) ? 0 : getNextruntime().hashCode());
        result = prime * result + ((getLastruntime() == null) ? 0 : getLastruntime().hashCode());
        result = prime * result + ((getLasterrortime() == null) ? 0 : getLasterrortime().hashCode());
        result = prime * result + ((getJobtype() == null) ? 0 : getJobtype().hashCode());
        result = prime * result + ((getJobcall() == null) ? 0 : getJobcall().hashCode());
        result = prime * result + ((getJobcallparams() == null) ? 0 : getJobcallparams().hashCode());
        result = prime * result + ((getCron() == null) ? 0 : getCron().hashCode());
        result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode());
        result = prime * result + ((getRemark() == null) ? 0 : getRemark().hashCode());
        result = prime * result + ((getCreatetime() == null) ? 0 : getCreatetime().hashCode());
        result = prime * result + ((getCreateuserid() == null) ? 0 : getCreateuserid().hashCode());
        result = prime * result + ((getCreateusername() == null) ? 0 : getCreateusername().hashCode());
        result = prime * result + ((getUpdatetime() == null) ? 0 : getUpdatetime().hashCode());
        result = prime * result + ((getUpdateuserid() == null) ? 0 : getUpdateuserid().hashCode());
        result = prime * result + ((getUpdateusername() == null) ? 0 : getUpdateusername().hashCode());
        result = prime * result + ((getOrgid() == null) ? 0 : getOrgid().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", jobname=").append(jobname);
        sb.append(", runcount=").append(runcount);
        sb.append(", errorcount=").append(errorcount);
        sb.append(", nextruntime=").append(nextruntime);
        sb.append(", lastruntime=").append(lastruntime);
        sb.append(", lasterrortime=").append(lasterrortime);
        sb.append(", jobtype=").append(jobtype);
        sb.append(", jobcall=").append(jobcall);
        sb.append(", jobcallparams=").append(jobcallparams);
        sb.append(", cron=").append(cron);
        sb.append(", status=").append(status);
        sb.append(", remark=").append(remark);
        sb.append(", createtime=").append(createtime);
        sb.append(", createuserid=").append(createuserid);
        sb.append(", createusername=").append(createusername);
        sb.append(", updatetime=").append(updatetime);
        sb.append(", updateuserid=").append(updateuserid);
        sb.append(", updateusername=").append(updateusername);
        sb.append(", orgid=").append(orgid);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}